package com.java1412.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author java1412
 * @since 2023-10-27 14:08:48
 */
@RestController
public class HelloController {

    @Value("${server.port}")
    private String port;

    @RequestMapping(value = "/hi")
    public String home(
            @RequestParam(value = "name", required = false, defaultValue = "java1412") String name
    ) {
        return "hi " + name + " ,i am from port:" + port;
    }
}
